<template>
	<view class="wrapper">
		<u-toast ref="uToast" /><u-no-network></u-no-network>
		<u-navbar title="客户订单" safeAreaInsetTop fixed placeholder>
			<view class="coreshop-navbar-left-slot" slot="left">
				<!-- 	<u-icon name="arrow-left" size="19" @click="goNavigateBack"></u-icon>
				<u-line direction="column" :hairline="false" length="16" margin="0 8px"></u-line> -->
				<u-icon name="home" size="22" @click="goHome"></u-icon>
			</view>
			<view slot="right">
			</view>
		</u-navbar>

		<view class="tabs">
			<view class="tab" v-for="(item, index) in tabs" :class="{active: index === currTabIdx}"
				@click="handleTabClick(index)">
				<text>{{item.text}}</text>
			</view>
		</view>

		<view class="order-list">

		</view>
		<tab-bar />
	</view>
</template>

<script>
	export default {
		data() {
			return {
				tabs: [{
						type: 'all',
						text: '全部'
					},
					{
						type: 'dfk',
						text: '待付款'
					},
					{
						type: 'dfh',
						text: '待发货'
					},
					{
						type: 'dsh',
						text: '待收货'
					},
					{
						type: 'dpj',
						text: '待评价'
					},
				],
				currTabIdx: 0
			}
		},
		onLaunch() {
			uni.hideTabBar()
		},
		created() {

		},
		methods: {
			handleTabClick(index) {
				this.currTabIdx = index
			}
		}
	}
</script>

<style lang="scss" scoped>
	.wrapper {

		.tabs {
			display: flex;
			align-items: center;
			padding: 0 30rpx;

			.tab {
				position: relative;
				flex: 1;
				height: 80rpx;
				line-height: 80rpx;
				display: flex;
				justify-content: center;
				background-color: #F5F6F8;

				text {
					color: #8E8F91;
					font-weight: 600;
					font-size: 28rpx;
				}
			}

			.active {
				&::before {
					position: absolute;
					left: 50%;
					transform: translateX(-50%);
					bottom: 0;
					content: '';
					display: inline-block;
					width: 100%;
					height: 4rpx;
					background-color: #4E5255;
					border-radius: 18rpx;
				}

				text {
					color: #4E5255;
				}
			}
		}


	}
</style>